<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>extend 扩展</title>
    <script src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>extend 扩展</h1>
    <hr/>
    <author></author>
    <div id="author"></div>

    <script>
        var authorExtend = Vue.extend({
            template:`<p><a :href='authorUrl' target='_blank'>{{authorName}}</a></p>`,
            data: function(){
                return {
                    authorName: 'superbone',
                    authorUrl: 'http://www.baidu.com'
                }
            }
        });

        new authorExtend().$mount('author');
        new authorExtend().$mount('#author');

        //new authorExtend() 这里的实例对象就是扩展之后的new Vue()对象
    </script>

</body>
</html>